﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ManageComponent.aspx.cs" Inherits="WXYW.ManageComponent" %>

<%@ Register Namespace="WXYW.Controls" TagPrefix="WXYWControl" Assembly="WXYW.Common" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="Ajax" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
    元器件管理
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ButtonPlaceHolder" runat="server">
    关键字<asp:TextBox ID="keyWordTextBox" runat="server" Height="16px" onkeypress="enterTxtBox('searchLinkButton')"></asp:TextBox><asp:LinkButton
        ID="searchLinkButton" runat="server" OnClick="searchLinkButton_Click">查询</asp:LinkButton><asp:LinkButton
            ID="resetLinkButton" runat="server" OnClick="resetLinkButton_Click">清除</asp:LinkButton>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="RightContentPlaceHolder" runat="server">
    <asp:GridView ID="AccessoryListGridView" runat="server" 
        CssClass="tableList" Width="100%" AllowSorting="true"
        AutoGenerateColumns="False" AllowPaging="true" OnRowCommand="AccessoryListGridView_RowCommand"
        OnRowDataBound="AccessoryListGridView_RowDataBound" OnPageIndexChanging="AccessoryListGridView_PageIndexChanging"
        PageSize="20"  
        onsorting="AccessoryListGridView_Sorting">
        <Columns>
            <asp:TemplateField HeaderImageUrl="~/image/operateicon/button_Select.gif">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="IDLbl" runat="server"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="物料号" DataField="MaterialNO">
                <HeaderStyle Wrap="False" />
                <ItemStyle HorizontalAlign="Left" Wrap="False" />
            </asp:BoundField>
            <asp:BoundField HeaderText="原料型号" DataField="ModelNO" SortExpression="ModelNO">
                <HeaderStyle Wrap="False" />
                <ItemStyle HorizontalAlign="Left" Wrap="False" />
            </asp:BoundField>
            <asp:BoundField HeaderText="原料分类" DataField="Class" SortExpression="Class">
                <HeaderStyle Wrap="False" />
                <ItemStyle Wrap="False" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="原料描述">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Description") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:TextBox ID="Label1" runat="server" CssClass="NOBorderTxtBox" TextMode="MultiLine"
                        Rows="1" Text='<%# Bind("Description") %>' ReadOnly="true" Width="130px"></asp:TextBox>
                </ItemTemplate>
                <HeaderStyle Wrap="False" />
                <ItemStyle HorizontalAlign="Left" Wrap="False" Width="130px" />
            </asp:TemplateField>
            <asp:BoundField HeaderText="收费价格" DataField="Price">
                <HeaderStyle Wrap="False" />
                <ItemStyle HorizontalAlign="Left" Wrap="False" />
            </asp:BoundField>
            <asp:BoundField DataField="Station" HeaderText="储存地" SortExpression="Station">
                <HeaderStyle Wrap="False" />
                <ItemStyle HorizontalAlign="Left" Wrap="False" />
            </asp:BoundField>
            <asp:BoundField HeaderText="原料数量" DataField="Count">
                <HeaderStyle Wrap="False" />
                <ItemStyle HorizontalAlign="Left" Wrap="False" />
            </asp:BoundField>
            <asp:BoundField HeaderText="使用数量" DataField="UseTimes">
                <HeaderStyle Wrap="False" />
                <ItemStyle Wrap="False" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="转储" ShowHeader="False">
                <ItemTemplate>
                    <img src="image/operateicon/back_back.gif" alt="" />
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" CommandName="Transfer"
                        Text="转储" CommandArgument='<%#Eval("ID") %>'></asp:LinkButton>
                    <img src="image/operateicon/docdelete.gif" alt="" />
                    <asp:LinkButton ID="LinkButton5" runat="server" CausesValidation="false" CommandName="DeleteA"
                        Text="删除" CommandArgument='<%#Eval("ID") %>'></asp:LinkButton>
                    <img src="image/operateicon/docedit.gif" alt="" />
                    <asp:LinkButton ID="editLnkBtn" runat="server" CausesValidation="false" CommandName="Edit"
                        Text="修改" CommandArgument='<%#Eval("ID") %>'></asp:LinkButton>
                </ItemTemplate>
                <HeaderStyle Wrap="False" />
            </asp:TemplateField>
        </Columns>
        <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="False" />
        <PagerTemplate>
            本类记录<span style="color: Red"><%= RecordsNumber%></span>条, <span style="color: Red">20</span>条/页
            当前 <span style="color: Red">
                <%= AccessoryListGridView.PageIndex + 1%>/<%= AccessoryListGridView.PageCount%></span>页
            <asp:LinkButton CommandName="Page" CommandArgument="First" ID="LinkButton1" runat="server"
                Style="color: blue">首页</asp:LinkButton><asp:LinkButton CommandName="Page" CommandArgument="Prev"
                    ID="LinkButton2" runat="server" Style="color: blue">|上一页</asp:LinkButton>
            <asp:LinkButton CommandName="Page" CommandArgument="Next" ID="LinkButton3" runat="server"
                Style="color: blue">下一页</asp:LinkButton><asp:LinkButton CommandName="Page" CommandArgument="Last"
                    ID="LinkButton4" runat="server" Style="color: blue">|尾页</asp:LinkButton>
            转到<asp:DropDownList ID="pageDDL" runat="server" AutoPostBack="True" OnSelectedIndexChanged="pageDDL_SelectedIndexChanged">
            </asp:DropDownList>
        </PagerTemplate>
        <HeaderStyle ForeColor="White" Font-Bold="True" BackColor="#A55129"></HeaderStyle>
    </asp:GridView>
    <div style="width: 100%; vertical-align: middle; background-color: #CCCCCC; text-align: left;
        line-height: 30px">
        <asp:Label ID="MsgLbl" runat="server" ForeColor="Red"></asp:Label>
    </div>
    <!--转储元器件-->
    <asp:HiddenField ID="HideTransferAccessoryButton" runat="server" />
    <Ajax:ModalPopupExtender ID="TransferAccessoryModalPopupExtender" TargetControlID="HideTransferAccessoryButton"
        PopupControlID="TransferAccessoryPanel" BackgroundCssClass="modalBackground"
        runat="server" Drag="true" PopupDragHandleControlID="TransferDragBar" CancelControlID="CloseTransferButton">
    </Ajax:ModalPopupExtender>
    <asp:Panel ID="TransferAccessoryPanel" CssClass="modalPopup" Width="600px" runat="server"
        DefaultButton="SaveTransferAccessoryButton" OnLoad="TransferAccessoryPanel_Load">
        <!-- Header -->
        <div class="box-header" id="TransferDragBar">
            <img src="image/stdBox_left_top.gif" alt="" />
            <h2>
                转储元器件</h2>
        </div>
        <div class="functionPanel">
            <table>
                <tr>
                    <td style="width: 100px">
                        物料号:
                    </td>
                    <td style="width: 150px">
                        <asp:TextBox ID="TransferAccessoryMaterialNOTextBox" runat="server" Enabled="false"></asp:TextBox>
                    </td>
                    <td style="width: 10px">
                    </td>
                    <td style="width: 100px">
                        原料型号:
                    </td>
                    <td style="width: 150px">
                        <asp:TextBox ID="TransferAccessoryModelNOTextBox" runat="server" Enabled="false"></asp:TextBox>
                    </td>
                    <td style="width: 10px">
                    </td>
                </tr>
                <tr>
                    <td style="width: 100px">
                        原料描述:
                    </td>
                    <td style="width: 150px">
                        <asp:TextBox ID="TransferAccessoryDescriptionTextBox" runat="server" Enabled="false"></asp:TextBox>
                    </td>
                    <td style="width: 10px">
                    </td>
                    <td style="width: 100px">
                        储存地:
                    </td>
                    <td style="width: 150px">
                        <asp:DropDownList ID="TransferAccessoryStationsDropDownList" runat="server" Width="130px">
                        </asp:DropDownList>
                    </td>
                    <td style="width: 10px">
                    </td>
                </tr>
                <tr>
                    <td style="width: 100px">
                        原料数量:
                    </td>
                    <td style="width: 150px">
                        <asp:TextBox ID="TransferAccessoryCountTextBox" runat="server" Enabled="false"></asp:TextBox>
                    </td>
                    <td style="width: 10px">
                    </td>
                    <td style="width: 100px">
                        转储数量:
                    </td>
                    <td style="width: 150px">
                        <asp:TextBox ID="TransferCountTextBox" runat="server"></asp:TextBox>
                    </td>
                    <td style="width: 10px">
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="请输入合法的增加数量；"
                            Text="*" ControlToValidate="TransferCountTextBox" ValidationGroup="TransferAccessoryValidation"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="请输入合法的增加数量；"
                            Text="*" ValidationExpression="^[0-9]+$" ControlToValidate="TransferCountTextBox"
                            ValidationGroup="TransferAccessoryValidation"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td colspan="6" align="center">
                        <asp:Button ID="SaveTransferAccessoryButton" runat="server" Text="保存" ValidationGroup="TransferAccessoryValidation"
                            OnClick="SaveTransferAccessoryButton_Click" />
                        <asp:Button ID="CloseTransferButton" runat="server" Text="关闭" />
                    </td>
                </tr>
                <tr>
                    <td colspan="6">
                        <asp:Label ID="TransferMsgLbl" runat="server" ForeColor="Red"></asp:Label>
                        <asp:ValidationSummary ID="TransferAccessoryValidationSummary" runat="server" EnableClientScript="true"
                            DisplayMode="SingleParagraph" ValidationGroup="TransferAccessoryValidation" />
                    </td>
                </tr>
            </table>
        </div>
        <div class="box-footer">
            <img alt="" src="image/stdBox_left_bottom.gif" />
            <p>
                &nbsp;</p>
        </div>
    </asp:Panel>
</asp:Content>
